package cn.com.dcsgo.feign;

import cn.com.dcsgo.dto.MemberAddressDTO;
import cn.com.dcsgo.dto.MemberInfoDTO;
import cn.com.dcsgo.feign.fallback.MemberFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * 会员 FeignClient
 *
 * @author Dcsgo
 * @since 2025/11/6 13:08
 */
@FeignClient(value = "member-service", fallback = MemberFeignClientFallback.class)
public interface MemberFeignClient {

    /**
     * 获取会员昵称和头像
     *
     * @param openIds 会员ID列表
     * @return 会员信息列表，包含会员ID、昵称、头像
     */
    @GetMapping("rpc/member/nick-name-and-pic")
    List<MemberInfoDTO> findMemberNickNameAndPicByOpenIds(@RequestParam("openid") Set<String> openIds);

    /**
     * 获取会员默认收货地址
     *
     * @param openid 会员ID
     * @return 会员默认收货地址
     */
    @GetMapping("rpc/member/address/default/openid/{openid}")
    MemberAddressDTO getMemberDefaultAddress(@PathVariable("openid") String openid);
}
